package tech.aistar.entity.User;



import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

/**
 * Created by lenovo on 2019/10/1.
 */
public class Register {
    private Integer id;

    @NotNull(message = "账号不能为空")
    @Pattern(regexp = "^1[3|4|5|8][0-9]\\d{4,8}$",message = "{v.user.username}",groups = {ValidGroup1.class})
    private String phone;

    @NotNull(message = "密码不能为空")
    @Pattern(regexp = "(?=.*([a-zA-Z].*))(?=.*[0-9].*)[a-zA-Z0-9-*/+.~!@#$%^&*()]{8,16}$",message ="{v.user.password}",groups = {ValidGroup1.class})
    private String password;

    @NotNull(message = "验证码不能为空")
    @Pattern(regexp = "^[1-9]\\d{5}$",message = "{v.user.er}",groups = {ValidGroup1.class})
    private String verCode;
    private Integer codeStatus;
    private String email;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getVerCode() {
        return verCode;
    }

    public void setVerCode(String verCode) {
        this.verCode = verCode;
    }

    public Integer getCodeStatus() {
        return codeStatus;
    }

    public void setCodeStatus(Integer codeStatus) {
        this.codeStatus = codeStatus;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    @Override
    public String toString() {
        final StringBuilder sb = new StringBuilder("Register{");
        sb.append("id=").append(id);
        sb.append(", phone='").append(phone).append('\'');
        sb.append(", password='").append(password).append('\'');
        sb.append(", verCode=").append(verCode);
        sb.append(", codeStatus=").append(codeStatus);
        sb.append(", email='").append(email).append('\'');
        sb.append('}');
        return sb.toString();
    }
}
